<template>
    <h1>这是子页面</h1>
    <button @click = "router.push('/')">返回上一页</button>
    <hr/>
    <!-- <indexChild :msg="msg" ></indexChild> -->
     <!-- 子传父----{{ num }} -->
    <!-- <indexChild @add="add" @reduce="reduce"></indexChild> -->

     <!-- <mark>{{ obj }}</mark>----<em>{{ myobj }}</em> -->
    <!-- <indexChild ref="child"></indexChild>
    <button @click="fn">打开模态窗口</button> -->
</template>

<script setup lang="ts">
    // import router from '@/router';
    import { onMounted, provide, reactive, ref ,type Ref} from 'vue';
    import { useRouter } from 'vue-router';
    // 导入子组件
    import indexChild from '@/components/indexChild.vue';
    // 引入接口
    import type { definePropsType } from '@/model';
    
    let router = useRouter();
    // let msg = "图图"
    // let num = ref<number|string>("100")
    // let add = async(v:any,a:number)=>{
    //     num.value+=v
    //     console.log(a);
        
    // }
    // let reduce = async(v:any)=>{
    //     num.value-=v;//将字符串隐式转化为数值
    // }

    // let num1:Ref<number|string> = ref("100");
    // let obj = reactive<definePropsType>({
    //     msg:"nigulaias"
    // })

    // interface Peo{
    //     username:string;
    //     age:number;
    // }
    // let myobj:Peo ={
    //     username:"张三",
    //     age:12
    // }

    // let flag = ref<number>(199);
    // provide("num",flag)
    // let fn=()=>{
	// 	child.value?.openModal();
    //     console.log(child.value?.a);
        
	// }
    // let child = ref<InstanceType<typeof indexChild>|null>(null)
    // onMounted(()=>{
    //     console.log(child.value);
        
    // })
</script>

<style scoped>

</style>